import java.util.Scanner;
public class test666 {
    public static void main(String[] args) {
        //将输入数字记录到数组中
        //先知道数字是几位数
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数字");
        int num = sc.nextInt();
        //对数字进行取余
        int temp = num;
        int count = 0;
        while (num != 0) {
            num = num / 10;
            count++;
        }
        //创建数组
        int[] newArr = new int[count];
        //将数字记录到数组中
        int index = newArr.length - 1;
        while (temp != 0) {
            int ge = temp % 10;
            temp = temp / 10;
            newArr[index] = ge;
            index--;
        }

        //再将数字记录到数组中
        for (int i = 0; i < newArr.length; i++) {
            newArr[i] = newArr[i] + 5;
        }
        for (int i = 0; i < newArr.length; i++) {
            newArr[i] = newArr[i] % 10;
        }
        for (int i = 0,j=newArr.length-1; i<j;j--, i++) {
            int tem = newArr[i];
            newArr[i] = newArr[j];
            newArr[j] = tem;
        }
        System.out.println("加密后的数字为：");
        for (int i = 0; i < newArr.length; i++) {
            System.out.print(newArr[i]);
        }
    }
}
